// Eric Battalio
// http://blogs.msdn.com/ebattalio
// BizTalk Server 2006
// 
// Modified by Ignacio Quijas 
// Action: Recompiled for BizTalk 2010 Compatibility
// Last Modification Date: February 2011
//
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Microsoft.BizTalk.BaseFunctoids;

namespace BizTalk.MapperExtensions.DBFunktoids
{
    class ErrorExtractor : BaseFunctoid
    {
        public ErrorExtractor()
            : base()
        {
            // Functoid ID must be > 6000
            ID = int.Parse(DBFunktoids.IDS_ERROREXTRACTOR_ID);

            // Resource assembly for functoid
            SetupResourceAssembly("BizTalk.MapperExtensions.DBFunktoids.DBFunktoids", Assembly.GetExecutingAssembly());

            // Configure text and toolbox pic
            SetName("IDS_ERROREXTRACTOR_NAME");
            SetTooltip("IDS_ERROREXTRACTOR_TOOLTIP");
            SetDescription("IDS_ERROREXTRACTOR_DESCRIPTION");
            SetBitmap("IDB_ERROREXTRACTOR_BITMAP");

            // The error extractor expects one input:
            //  1: Guid for the source
            SetMinParams(1);
            SetMaxParams(1);

            // DBFunk.ExtractError
            SetExternalFunctionName(GetType().Assembly.FullName, "BizTalk.MapperExtensions.DBFunktoids.DBFunk", "ExtractError");

            // Category, output connection types
            Category = FunctoidCategory.DatabaseExtract;
            OutputConnectionType = ConnectionType.All;

            AddInputConnectionType(ConnectionType.AllExceptRecord);
        }
    }
}
